<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/

Route::get('/', function () {
    return view('welcome');
});

//404 not found
Route::get('404',function(){
	abort(404);
});

//创建路由组
Route::group(['middleware'=>'login'],function(){
	// 隐式路由
	Route::Controller('/admin/','AdminController');
	Route::Controller('/admin/user','UserController');
	// 分类的路由
	Route::Controller('/admin/cate','CateController');
	// 评论的路由
	Route::Controller('/admin/comments','CommentsController');
	// 用户地址的路由
	Route::Controller('/admin/address','UseraddressController');
	//商品管理
	Route::Controller('/admin/goods','GoodsController');
	// 退换货管理

	Route::Controller('/admin/regoods','ReGoodsController');

	Route::Controller('admin/regoods','ReGoodsController');

	//用户订单路由
	Route::Controller('admin/order','AdminOrderController');


	// 轮播图管理
	Route::Controller('/admin/carousel','CarouselController');
	// 确认订单
	// 创建订单
	// Route::match(['post','get'],'/orders/create','OrdersController@create');
	// 前台个人中心
	Route::Controller('/personal','PersonalController');


});
//创建前台路由组
Route::group(['middleware'=>'weblogin'],function(){
	
Route::Controller('/orders','OrdersController');
Route::Controller('/order','OrderController');

});

//购物车进入
Route::Controller('/home/cart','CartController');
//前台商品列表页入口
Route::Controller('/home/goodslist','GoodslistController');
//后台登录路由
Route::Controller('/admin/log','LoginController');

Route::Controller('/home','RegController');
//Route::Controller('/home/email','RegController');
Route::controller('/email','EmailController');

Route::match(['get', 'post'], '/order/insert', 'OrderController@insert');


//网站首页访问
Route::Controller('/','IndexController');
